package com.example.dao;

import com.example.model.pojo.Problem;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @Description //TODO
 * @Date 2022/9/13 20:25
 * @Author lonng
 **/
public interface ProblemDao extends JpaRepository<Problem,Integer> {
    @Query(value = "select * from problem  where id=?1",nativeQuery = true)
    Problem findByPId(Integer id);

    List<Problem> findAllByDifficulty(Integer difficulty);

    List<Problem> findAllByTitleContains(String title);




}
